<template>
  <view class="container">
    <!-- 顶部个人信息 -->
    <view class="header">
      <view class="avatar-box">
        <image class="avatar" src="https://www.ruanzi.net/jy/wxuser/103/images/pages/我的图标.png" mode="aspectFill"></image>
      </view>
      <text class="username">我的</text>
    </view>

    <!-- 健康综合评分卡片 -->
    <view class="health-card">
      <view class="score-area">
        <view class="score-circle">
          <text class="score-number">71</text>
          <text class="score-text">综合分数</text>
        </view>
      </view>
      <view class="score-info">
        <image class="sound-icon" src="https://www.ruanzi.net/jy/wxuser/103/images/pages/喇叭.png" mode="aspectFit"></image>
        <text class="score-tip">基于您今日健康数据表示，各项指标正常！请继续保持哦~</text>
        <image class="mascot" src="https://www.ruanzi.net/jy/wxuser/103/images/pages/分数小狗.png" mode="aspectFit"></image>
      </view>
    </view>

    <view class="monitor-title">健康监测</view>

    <!-- 血糖卡片 -->
    <view class="glucose-card">
      <view class="glucose-container">
        <view class="glucose-left">
          <view class="indicator-header">
            <text class="indicator-name">血糖</text>
            <view class="indicator-icon">
              <image src="https://www.ruanzi.net/jy/wxuser/103/images/pages/血糖图标.png" mode="aspectFit"></image>
            </view>
          </view>
          <text class="glucose-status">正常</text>
          <text class="glucose-value">6.1mmol/L</text>
        </view>

        <view class="glucose-chart">
          <image class="chart-img" src="https://www.ruanzi.net/jy/wxuser/103/images/pages/血糖统计图.png" mode="aspectFit"></image>
        </view>
      </view>
    </view>

    <!-- 血压卡片 -->
    <view class="indicator-card">
      <view class="indicator-container">
        <view class="indicator-left">
          <view class="indicator-header">
            <text class="indicator-name">血压</text>
            <view class="indicator-icon">
              <image src="https://www.ruanzi.net/jy/wxuser/103/images/pages/血压.png" mode="aspectFit"></image>
            </view>
          </view>
          <text class="indicator-status normal">正常</text>
        </view>

        <view class="bp-detail">
          <view class="bp-tabs">
            <text class="bp-tab">偏低</text>
            <text class="bp-tab active">正常</text>
            <text class="bp-tab">偏高</text>
          </view>
          <text class="bp-measuring">预测血压值</text>
          <view class="bp-values">
            <view class="bp-item">
              <text class="bp-label">收缩压</text>
              <view class="bp-value-box">
                <text class="bp-value">119</text>
                <text class="bp-unit">mmHg</text>
              </view>
              <text class="bp-range">正常值: 90-139</text>
            </view>
            <view class="bp-item">
              <text class="bp-label">舒张压</text>
              <view class="bp-value-box">
                <text class="bp-value">80</text>
                <text class="bp-unit">mmHg</text>
              </view>
              <text class="bp-range">正常值: 60-89</text>
            </view>
          </view>
        </view>
      </view>
    </view>

    <!-- 心率卡片 -->
    <view class="monitor-card">
      <view class="glucose-container">
        <view class="glucose-left">
          <view class="indicator-header">
            <text class="indicator-name">心率</text>
            <view class="indicator-icon">
              <image src="https://www.ruanzi.net/jy/wxuser/103/images/pages/心率.png" mode="aspectFit"></image>
            </view>
          </view>
          <text class="glucose-status">正常</text>
          <text class="glucose-value">59次/分钟</text>
        </view>

        <view class="glucose-chart">
          <image class="chart-img" src="https://www.ruanzi.net/jy/wxuser/103/images/pages/心率统计图.png" mode="aspectFit"></image>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
  // 页面逻辑可以在这里添加
</script>

<style>
  .container {
    padding: 20px;
    background: linear-gradient(to bottom,
        #fffff0 0%,
        #fff7dc 25%,
        #ffd08e 50%,
        #ffe9c1 75%,
        #fffaf4 100%);
    min-height: 100vh;
  }

  .header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
  }

  .avatar-box {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #f0f0f0;
    overflow: hidden;
    border: 1px solid #e0e0e0;
  }

  .avatar {
    width: 100%;
    height: 100%;
  }

  .username {
    font-size: 20px;
    font-weight: bold;
    margin-left: 15px;
  }

  /* 健康评分卡片 */
  .health-card {
    position: relative;
    display: flex;
    background: linear-gradient(to right, #ffbb66, #ffa64d);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 2px 2px 10px 2px rgba(148, 4, 0, 0.5);
  }

  .score-area {
    margin-right: 5px;
  }

  .score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.3);
  }

  .score-number {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    line-height: 1;
  }

  .score-text {
    font-size: 12px;
    color: #666;
  }

  .score-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: -30px;
  }

  .score-tip {
    color: #333;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: -20px;
    font-weight: bold;
  }

  .mascot {
    width: 100px;
    height: 100px;
    align-self: flex-end;
  }

  .sound-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
  }

  .monitor-title {
    font-size: 18px;
    margin: 8px;
  }

  /*血糖*/
  .glucose-card {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 2px 2px 2px 2px rgba(255, 170, 0, 0.2);
    margin-bottom: 25px;
  }

  .glucose-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: 120px;
    width: 100%;
  }

  .glucose-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 35%;
    justify-content: flex-start;
  }

  .glucose-status {
    font-size: 20px;
    font-weight: bold;
    color: #4caf50;
    margin-top: 8px;
  }

  .glucose-value {
    font-size: 15px;
    color: #333;
    margin-top: 20px;
    font-weight: bold;
  }

  .glucose-chart {
    width: 70%;
    height: 100%;
    display: flex;
    align-items: center;
  }

  .chart-img {
    width: 100%;
    height: 100%;
  }

  /*血压*/
  .indicator-card {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 2px 2px 2px 2px rgba(255, 170, 0, 0.2);
    margin-bottom: 15px;
  }

  .indicator-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: 120px;
  }

  .indicator-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 35%;
    justify-content: flex-start;
  }

  .indicator-header {
    display: flex;
    align-items: center;
  }

  .indicator-name {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin-right: 10px;
  }

  .indicator-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .indicator-icon image {
    width: 35px;
    height: 35px;
  }

  .indicator-status {
    font-size: 20px;
    font-weight: bold;
    color: #4caf50;
    margin-top: 45px;
  }

  /* 血压详情 */
  .bp-detail {
    width: 60%;
    display: flex;
    flex-direction: column;
  }

  .bp-tabs {
    display: flex;
    border-radius: 30px;
    overflow: hidden;
    background-color: #f5f5f5;
    height: 30px;
    margin-bottom: 10px;
  }

  .bp-tab {
    flex: 1;
    text-align: center;
    line-height: 30px;
    font-size: 14px;
    color: #999;
    position: relative;
  }

  .bp-tab.active {
    background-color: #f89855;
    color: white;
    font-weight: bold;
  }

  .bp-measuring {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-bottom: 5px;
    position: relative;
  }

  .bp-measuring::before,
  .bp-measuring::after {
    content: '';
    position: absolute;
    top: 50%;
    height: 1px;
    width: 25%;
    background-color: #ffaa00;
  }

  .bp-measuring::before {
    left: 0;
  }

  .bp-measuring::after {
    right: 0;
  }

  .bp-values {
    display: flex;
    justify-content: space-between;
  }

  .bp-item {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .bp-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
    font-weight: bold;
  }

  .bp-value-box {
    display: flex;
    align-items: flex-end;
  }

  .bp-value {
    font-size: 23px;
    font-weight: bold;
    color: #333;
  }

  .bp-unit {
    font-size: 10px;
    color: #999;
    margin-left: 2px;
    margin-bottom: 5px;
    font-weight: bold;
  }

  .bp-range {
    font-size: 12px;
    color: #999;
  }

  /*心率*/
  .monitor-card {
    background-color: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 2px 2px 2px 2px rgba(255, 170, 0, 0.2);
    margin-bottom: 15px;
  }

  .normal {
    color: #4caf50;
  }

  /* 添加断行样式 */
  .break-line {
    height: 8px;
    width: 100%;
  }
</style>